Skip to content

feat: support GTS spec v0.14.4 - #128

Merged
Artifizer merged 1 commit into
GlobalTypeSystem:mainfrom
aviator5:v0.14.4-support
Sep 30, 2026
Merged

Artifizer merged 1 commit into
GlobalTypeSystem:mainfrom
aviator5:v0.14.4-support

Conversation

@aviator5

@aviator5 aviator5 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Pin the conformance suite to v0.14.4. The release adds the batch registration contract to README §9.3 and new tests for it, plus a few corner cases:

  • POST /type-schemas honors ?validate and gts-ref-validation like /entities. A malformed mode is refused with 422 before any entry is registered.
  • With validate=true the whole batch is staged first, so an entry may $ref or derive from one later in the array. Staged entries are then validated until no new failure appears: a rejected entry is unstaged and the survivors are re-checked, so nothing commits on top of a rejected sibling. The batch may partly succeed; a rejected entry never commits, and an id already stored with the same content stays stored.
  • The trait-schema integrity check compiles each x-gts-traits-schema fragment under the host document's dialect instead of the default draft, so a Draft-07 tuple items: [...] is no longer rejected.

GtsOps::add_schemas keeps its behavior; the new add_schemas_with takes the validate flag and the reference-validation mode.

Summary by CodeRabbit

  • New Features
    • Batch schema registration now supports validation and reference-validation options. Schemas can reference other entries in the same batch; invalid entries and entries that depend on them are rejected, while valid entries can still be accepted.
  • Bug Fixes
    • Trait-schema checks now respect the host schema’s dialect when fragments do not specify their own, including dialect-specific tuple items behavior.
  • Documentation
    • Updated the listed supported GTS specification version to 0.14.4.

Pin the conformance suite to v0.14.4. The release adds the batch
registration contract to README §9.3 and new tests for it, plus a few
corner cases:

- `POST /type-schemas` honors `?validate` and `gts-ref-validation` like
  `/entities`. A malformed mode is refused with 422 before any entry is
  registered.
- With `validate=true` the whole batch is staged first, so an entry may
  `$ref` or derive from one later in the array. Staged entries are then
  validated until no new failure appears: a rejected entry is unstaged and
  the survivors are re-checked, so nothing commits on top of a rejected
  sibling. The batch may partly succeed; a rejected entry never commits,
  and an id already stored with the same content stays stored.
- The trait-schema integrity check compiles each `x-gts-traits-schema`
  fragment under the host document's dialect instead of the default draft,
  so a Draft-07 tuple `items: [...]` is no longer rejected.

`GtsOps::add_schemas` keeps its behavior; the new `add_schemas_with` takes
the `validate` flag and the reference-validation mode.

Signed-off-by: Aviator 5 <ai.agent.tor@gmail.com>
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: e6d6fbe9-b1e0-4400-87ec-38d92069fa5a

📥 Commits

Reviewing files that changed from the base of the PR and between 84a4d8d and c97fa06.

📒 Files selected for processing (6)
  • .gts-spec-version
  • README.md
  • gts-cli/src/server.rs
  • gts-cli/tests/server_tests.rs
  • gts/src/ops.rs
  • gts/src/schema_traits.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The CLI batch schema endpoint now supports validation and reference-validation modes. Batch registration validates entries and removes invalid new schemas, including dependents of rejected entries. Trait integrity checks use the host schema dialect for fragments without their own dialect. The supported specification version is now 0.14.4.

Changes

Batch schema registration

Layer / File(s) Summary
Batch validation and rejection
gts/src/ops.rs, gts/src/ops.rs
Batch registration validates schemas against the batch, removes invalid new entries, and repeats validation for survivors. Tests cover forward references, partial success, dependent rejection, and preservation of previously stored entries.
Endpoint settings and version
gts-cli/src/server.rs, gts-cli/tests/server_tests.rs, .gts-spec-version, README.md
The /type-schemas endpoint resolves and passes reference-validation settings and the validation flag to batch registration. Tests cover batch validation and malformed modes. The supported specification version changes to 0.14.4.

Trait schema dialect validation

Layer / File(s) Summary
Host dialect propagation and checks
gts/src/schema_traits.rs
Trait integrity validation receives the composed schema dialect and applies it to object fragments without their own $schema. Tests cover default-dialect behavior and tuple items under Draft-07 and Draft 2020-12.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Suggested reviewers: artifizer

Merge Risk: ⚪ Minimal · up to c97fa

No identified issue blocks merging after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to c97fa

Batch registration now has more complex validation and partial-success behavior, but the reviewed paths preserve the existing unvalidated option and did not establish a new security bypass. Deployment controls and resource limits remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — A caller able to use the batch endpoint controls submitted schemas and validation settings, affecting the server’s registration store. The evidence does not establish that caller’s deployment-level authorization or whether stores are shared across instances.

Trust Boundaries and Controls

  • observed — Query-mode parsing precedes the handler’s state lock and mutation. The handler passes the resolved mode and caller-supplied batch to GtsOps rather than writing directly to the store.

Resilience and Maintainability Implications

  • inferred — The mutable operations receiver and the HTTP handler’s state lock exclude overlapping batch transitions on the same server-held operations instance. They do not establish coordination between separate instances or a shared backing reader.

Hardening Proposals

  • proposed — If this endpoint is available to untrusted callers, establish a request-size or validation-work budget for staged batches and document the intended coordination model for multiple operations instances.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the primary change: support for GTS specification v0.14.4.
Docstring Coverage ✅ Passed Docstring coverage is 90.48% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 4 files. (2 skipped: 2 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@code-ranker-app

Copy link
Copy Markdown
Contributor

code-ranker

Built on a fork. View full report ↗

rust
Metric Baseline Current Δ
Complexity
cognitive — Cognitive complexity 48.7 49 $\color{#c0392b}{+0.239}$
cyclomatic — Cyclomatic complexity 66.4 66.7 $\color{#c0392b}{+0.271}$
Coupling
hk — God-object risk 214.9K 215.9K $\color{#c0392b}{+1021}$
Halstead
bugs — Estimated bugs 1.8 1.8 $\color{#c0392b}{+0.015}$
effort — Implementation effort 641.5K 650.1K $\color{#c0392b}{+8579}$
length — Total tokens 1202 1208 $\color{#c0392b}{+5.6}$
time — Coding time (s) 35.6K 36.1K $\color{#c0392b}{+477}$
vocabulary — Distinct symbols 139 139 $\color{#c0392b}{+0.188}$
volume — Code volume 9553 9601 $\color{#c0392b}{+48.5}$
Lines of Code
blank — Blank lines 32.8 32.8 +0.057
cloc — Comment lines 83.2 83.5 +0.347
sloc — Source lines 269 270 +1
tloc — Test lines 365 368 +3.4
Maintainability
mi — Maintainability index 42.4 43.4 $\color{#2a7a30}{+0.96}$

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@aviator5
aviator5 requested a review from Artifizer September 29, 2026 13:50
@Artifizer
Artifizer merged commit cd9cd5a into GlobalTypeSystem:main Sep 30, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants